
#ifndef __CANIMATIONMANGER_H
#define __CANIMATIONMANGER_H

#include "stdafx.h"
#include "CAnimation.h"
#include "AnimInfo.h"

class CAnimationManager
{
private:
	static CAnimationManager* pInstance;

	vector<CAnimation*>		m_vAnimations;

	CAnimationManager();
	~CAnimationManager();
	CAnimationManager(const CAnimationManager&);
	CAnimationManager& operator=(const CAnimationManager&);

public:
	static CAnimationManager* GetInstance();
	void DeleteInstance();

	void Render(AnimInfo* anim, int PosX, int PosY, float fScale, float fRotation, bool isPlayed, DWORD dwColor);
	void Update(AnimInfo* anim, float fElapsedTime);
	RECT GetImageRect(AnimInfo* Anim);
	RECT GetCollisionRect(AnimInfo* Anim);
	RECT GetHitRect(AnimInfo* Anim);
	vector<POINT*>& GetParticles(AnimInfo* Anim);
	POINT GetAnchorPoint(AnimInfo* Anim);
	vector<CAnimation*> GetAnimations () {return m_vAnimations;}

	void RandomAnim(AnimInfo* anim);
	bool LoadAnim(const char* filename);
	void FindAnim(string AnimID, AnimInfo* anim);
	string GetAnimID(AnimInfo* anim){return m_vAnimations[anim->GetCurAnim()]->GetAnimationID();}
	void AddAnimation(CAnimation* Anim);
	void RemoveAnimation();
	void Shutdown();
};

#endif
